package aboutTheBook;
public class Book {
    private String bookType;//书籍类型
    private String title;//书名
    private String author;//作者
    private String location;//存放地点
    private int numberOfLoans;//借阅次数
    private boolean loanStatus;//借阅状态

    //构造方法
    public Book(String bookType,
                String title,
                String author,
                String location) {
        this.bookType = bookType;
        this.title = title;
        this.author = author;
        this.location = location;
    }
    //设置书籍方法
    public void setBookType(String bookType) {
        this.bookType = bookType;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public void setAuthor(String author) {
        this.author = author;
    }
    public void setLocation(String location) {
        this.location = location;
    }
    public void setLoanStatus(boolean bool) {
        this.loanStatus = bool;
    }
    public void setNumberOfLoans(int number) {
        this.numberOfLoans = number;
    }

    //获取书籍方法
    public String getBookType() {
        return bookType;
    }
    public String getTitle() {
        return title;
    }
    public String getAuthor() {
        return author;
    }
    public String getLocation() {
        return location;
    }
    public int getNumberOfLoans() {
        return this.numberOfLoans;
    }
    public boolean getLoanStatus() {
        return this.loanStatus;
    }

    @Override
    public String toString() {
        return
                "书籍类型：" + bookType + " "+ '\t'+ '|'+
                "书名：" +'《'+ title + '》' + "   "+'\t'+ '|'+
                "作者：" + author + " "+'\t'+ '|'+
                "存放地点：" + location + " "+'\t'+ '|'+
                "借阅次数：" + numberOfLoans + " "+'\t'+ '\t'+'|'+
                "书籍状态：" + (!loanStatus? "未借出" : "已借出") ;
    }
}
